<?php

class Empeval_Methods_Data_Reject {
	
	public $text;
	public $decision;
	public $attachment;
	public $status;
	public $lastModified;
	public $created;
	/**
	 * 
	 * @var Empeval_Methods_Data_BaseUser[]
	 */
	public $committees = array();
	
	/**
	 * 
	 * @var Empeval_Methods_Data_UserReject
	 */
	public $user = null;
	
	public function __construct(EmpevalRejections $reject) {
		$this->text = $reject->getText();
		$this->decision = $reject->getDecision();
		$this->status = $reject->getStatus();
		$this->attachment = ($reject->getAttachment() != null) ? Empeval_Config::getInstance()->fileUploader->publicDir . $reject->getAttachment() : null;
		$this->lastModified = $reject->getLastModified();
		$this->created = $reject->getCreated('d.m.Y');
		foreach ($reject->getCommitteess() as $value) {
			$this->committees[] = new Empeval_Methods_Data_BaseUser($value->getUsers());
		}
	}
	
}